projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de2550e
)
fix ancient memory leak in filter_vecs. (#706)
author
tsteven4
<13596209+tsteven4@users.noreply.github.com>
Sat, 20 Mar 2021 12:57:41 +0000
(06:57 -0600)
committer
GitHub
<noreply@github.com>
Sat, 20 Mar 2021 12:57:41 +0000
(06:57 -0600)
filter_vecs.cc
patch
|
blob
|
history
diff --git
a/filter_vecs.cc
b/filter_vecs.cc
index d20c5c2ec9ea703797321cc39dcfc272da116cd8..2f42409f1914b2d900c6bb8030f4e36d7e75ca4b 100644
(file)
--- a/
filter_vecs.cc
+++ b/
filter_vecs.cc
@@
-126,6
+126,16
@@
void FilterVecs::exit_filter_vecs()
{
for (const auto& vec : filter_vec_list) {
(vec.vec->exit)();
+ QVector<arglist_t>* args = vec.vec->get_args();
+ if (args && !args->isEmpty()) {
+ assert(args->isDetached());
+ for (auto& arg : *args) {
+ if (arg.argvalptr) {
+ xfree(arg.argvalptr);
+ *arg.argval = arg.argvalptr = nullptr;
+ }
+ }
+ }
}
}